import { http } from '@/utils/http/axios';

export interface BasicResponseModel<T = any> {
  code: number;
  message: string;
  result: T;
}

export interface BasicPageParams {
  pageNumber: number;
  pageSize: number;
  total: number;
}

export function getReservePage(params) {
  return http.request({
    url: '/record/page',
    method: 'get',
    params,
  });
}

export function getSearchReservePage(params) {
  return http.request({
    url: '/reserve/search',
    method: 'get',
    params,
  });
}

export function addReserve(params) {
  return http.request<BasicResponseModel>({
    url: '/reserve',
    method: 'POST',
    params,
  });
}

export function deleteReserve(id) {
  return http.request<BasicResponseModel>({
    url: `/reserve/${id}`,
    method: 'DELETE',
  });
}

export function updateReserve(params) {
  return http.request<BasicResponseModel>({
    url: '/reserve',
    method: 'PUT',
    params,
  });
}

export function getAllReserve() {
  return http.request({
    url: '/reserve/getAllReserve',
    method: 'get',
  });
}
